﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;

namespace BCMS.Business.DataContract
{
    public class ReleaseInfo : IComparer
    {
        public string Name { set; get; }
        public DateTime StartDate { set; get; }
        public DateTime ExpireDate { set; get; }
        public long Qtty { set; get; }
        public decimal ParValue { set; get; }
        public int Target { set; get; }
        public string Detail { set; get; }
        public string Note { set; get; }
        public int ReleaseId { set; get; }
        public int Kind { set; get; }
        public int Status { set; get; }
        public string RCode { set; get; }
        public long RLow { set; get; }
        public long RHigh { set; get; }

        public ReleaseInfo(){}

        #region IComparer Members

        public int Compare(object x, object y)
        {
            ReleaseInfo order1;
            ReleaseInfo order2;
            order1 = x as ReleaseInfo;
            order2 = y as ReleaseInfo;

            if (order1 == null)
                if (order2 == null)
                    return 0;
                else
                    return -1;
            else
                if (order2 == null)
                    return 1;
                else
                    return order1.StartDate.CompareTo(order2.StartDate);
        }

        #endregion
    }
}
